package h_factory.b_simple;


/**
 * 英雄制造者
 * Created by wug on 2016/7/6 0006.
 */
public class HeroMaker {

    public Hero makeHero(HeroMakerEnum enumer) {
        Hero hero = new Hero();
        hero.setName(enumer.getDesc());
        if (enumer.equals(HeroMakerEnum.GAREN)) {
            hero.setSkin("黄金德玛西亚");
            hero.setWeapon("金色巨剑");
        } else if (enumer.equals(HeroMakerEnum.YI)) {
            hero.setSkin("朋克风剑圣");
            hero.setWeapon("机械剑");
        } else if (enumer.equals(HeroMakerEnum.ANNI)) {
            hero.setSkin("小红帽安妮");
            hero.setWeapon("苹果");
        }
        return hero;
    }

    public enum HeroMakerEnum {
        GAREN(1, "盖伦"),
        YI(2, "易"),
        ANNI(3, "安妮");

        private final int type;
        private final String desc;

        HeroMakerEnum(int type, String desc) {
            this.type = type;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }
    }

}
